]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-theme-node: Unconditionally apply style margins on the actor
authorRui Matos <tiagomatos@gmail.com>
Fri, 27 Mar 2015 16:34:26 +0000 (17:34 +0100)
committerRui Matos <tiagomatos@gmail.com>
Fri, 27 Mar 2015 17:06:13 +0000 (18:06 +0100)
We currently don't have any code either in gnome-shell or
gnome-shell-extensions setting margins directly with the Clutter API.

On the other hand, the current behavior doesn't allow us to remove a
style class with margins and have that be reflected, so removing this
special casing seems like the right thing to do at this point.

https://bugzilla.gnome.org/show_bug.cgi?id=746902

src/st/st-theme-node-private.h
src/st/st-theme-node.c

index 7a2a383c0e3f70478d0dff517b6b8c28b9bc879d..f691cae6bb4b1effa33dc86b57ac9b4088238f43 100644 (file)
@@ -92,8 +92,6 @@ struct _StThemeNode {
   guint background_position_set : 1;
   guint background_repeat : 1;
 
-  gboolean margin_set : 4;
-
   guint properties_computed : 1;
   guint geometry_computed : 1;
   guint background_computed : 1;
index 7acb5708cb7cad5cbc43dcdf5796121cd2a0c3fa..4c8fabd403a65a990950effc79fc9eeea80a922b 100644 (file)
@@ -1672,25 +1672,13 @@ do_margin_property_term (StThemeNode *node,
     return;
 
   if (left)
-    {
-      node->margin[ST_SIDE_LEFT] = value;
-      node->margin_set |= 1 << ST_SIDE_LEFT;
-    }
+    node->margin[ST_SIDE_LEFT] = value;
   if (right)
-    {
-      node->margin[ST_SIDE_RIGHT] = value;
-      node->margin_set |= 1 << ST_SIDE_RIGHT;
-    }
+    node->margin[ST_SIDE_RIGHT] = value;
   if (top)
-    {
-      node->margin[ST_SIDE_TOP] = value;
-      node->margin_set |= 1 << ST_SIDE_TOP;
-    }
+    node->margin[ST_SIDE_TOP] = value;
   if (bottom)
-    {
-      node->margin[ST_SIDE_BOTTOM] = value;
-      node->margin_set |= 1 << ST_SIDE_BOTTOM;
-    }
+    node->margin[ST_SIDE_BOTTOM] = value;
 }
 
 static void
@@ -3188,18 +3176,10 @@ _st_theme_node_apply_margins (StThemeNode *node,
 
   _st_theme_node_ensure_geometry (node);
 
-  // In the case that a CSS margin is not specified, we don't to set a value
-  // of 0 to the clutter actor margin. In this manner it allows to use Clutter
-  // margin values set in the code. However, the margins that are set both in
-  // the code and in the CSS on the same side, the result is unpredictable.
-  if (node->margin_set & 1 << ST_SIDE_LEFT)
-     clutter_actor_set_margin_left (actor, st_theme_node_get_margin(node, ST_SIDE_LEFT));
-  if (node->margin_set & 1 << ST_SIDE_RIGHT)
-     clutter_actor_set_margin_right (actor, st_theme_node_get_margin(node, ST_SIDE_RIGHT));
-  if (node->margin_set & 1 << ST_SIDE_TOP)
-     clutter_actor_set_margin_top (actor, st_theme_node_get_margin(node, ST_SIDE_TOP));
-  if (node->margin_set & 1 << ST_SIDE_BOTTOM)
-     clutter_actor_set_margin_bottom (actor, st_theme_node_get_margin(node, ST_SIDE_BOTTOM));
+  clutter_actor_set_margin_left (actor, st_theme_node_get_margin(node, ST_SIDE_LEFT));
+  clutter_actor_set_margin_right (actor, st_theme_node_get_margin(node, ST_SIDE_RIGHT));
+  clutter_actor_set_margin_top (actor, st_theme_node_get_margin(node, ST_SIDE_TOP));
+  clutter_actor_set_margin_bottom (actor, st_theme_node_get_margin(node, ST_SIDE_BOTTOM));
 }
 
 static GetFromTermResult